<?php

namespace app\index\model;

use think\Model;

class Admin extends Model
{
    public function login($user_name,$pwd)
    {
        if($user_info = $this->getByUserName($user_name)){
            if(md5(md5($pwd).$user_info['salt']) === $user_info['password'])
            {   unset($user_info['password']);
                session('user_info',$user_info);
                return 'success';
            }else{
                return 'the waring of password';
            }
        }else{
            return 'have no this user_name';
        }
    }
}
